Imports Phoenix.DataAccess

Namespace Helpers.Lookup

    Public Class EmployeeLookupFormatter : Implements IFormatProvider, ICustomFormatter
        Public Function GetFormat(ByVal type As System.Type) As Object Implements IFormatProvider.GetFormat
            Return Me
        End Function

        Public Function Format(ByVal formatString As String, ByVal arg As Object, ByVal formatProvider As IFormatProvider) As String Implements ICustomFormatter.Format
            Dim e As DataSetData.Employee = AppDataLayer.Employees.FindByEmployeeID(Long.Parse(CType(arg, String)))
            If e Is Nothing Then
                Return Res.ItemUnknownName
            Else
                Return e.FullName
            End If
        End Function

    End Class

End Namespace
